package com.neusoft.springboot03.config;


import com.neusoft.springboot03.domain.Stu;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@PropertySource(value = {"classpath:jdbc.propertites"},ignoreResourceNotFound=true,encoding = "utf-8")
public class StuConfig {

    @Value("${stu.name}")
    private String name;

    @Value("${stu.age}")
    private int age;

    @Value("${stu.sex}")
    private String sex;


    @Bean
    public Stu getStu()
    {
        return new Stu(age,name,sex);
    }
}
